<?php

namespace app\advertisement\controller;

use app\common\controller\PCBase;
use app\BaseController;//测试专用
use app\advertisement\logic\ProxyownershipLogic;
use think\facade\Db;
use Throwable;
use app\common\library\Upload;

class Proxyownership extends BaseController
{


    public function initialize(): void
    {
        parent::initialize();
    }

    /**
     * index
     * @throws Throwable
     */
    public function index()
    {
        $params     = $this->request->post();
        $ProxyownershipLogic = new ProxyownershipLogic();
        return $ProxyownershipLogic->index($params);
    }

    
    /**
     * 添加
     * @throws Throwable
     */
    public function add()
    {
        $post = $this->request->post();
        $ProxyownershiplogLogic = new ProxyownershipLogic();
        $result = $ProxyownershiplogLogic->add($post);
        return $result;
    }

    /**
     * 回显
     * @throws Throwable
     */
    public function find($id = null)
    {
        $post = $this->request->post();
        $id = $post['id'] ?? 0;
        $ProxyownershiplogLogic = new ProxyownershipLogic();
        $result = $ProxyownershiplogLogic->find($id);
        return $result;
    }
    /**
     * 编辑
     * @throws Throwable
     */
    public function edit()
    {
        $post = $this->request->post();
        $ProxyownershiplogLogic = new ProxyownershipLogic();
        $result = $ProxyownershiplogLogic->edit($post);
        return $result;
    }

    /**
     * export
     * @throws Throwable
     */
    public function delete()
    {
        $params     = $this->request->post();
        return (new ProxyownershipLogic())->delete($params);
    }

}
